<?php defined('SYSPATH') or die('No direct access allowed.');


class Model_Desktop_Panel extends ORM {

	 protected $_has_many =  array('items' => array('model' => 'desktop_item', 'foreign_key' => 'panel_id')); 
	 protected $_belongs_to = array('desktop' => array('model' => 'user_desktop', 'foreign_key' => 'desktop_id'));
        

    public function rules()
	{
		return array(
			'title' => array(
				array('not_empty'),
				array('max_length', array(':value', 127)),
			)
                        
		);
	}
        
    public function filters()
	{
		return array(
			'title' => array(
                                //xss clean
				array(array('Security', 'xss_clean')),
                                array('trim')
			)      
		);
	}

	/**
	 * Labels for fields in this model
	 *
	 * @return array Labels
	 */
	public function labels()
	{
		return array(
			'title'         => __('Title')
		);
	}
}